package com.zy.service;

import com.zy.mapper.RoleMapper;
import com.zy.pojo.Role;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service("roleService")
public class RoleServiceImpl implements RoleService{
    @Resource
    private RoleMapper roleMapper;

    @Override
    public List<Role> getRoleList() {
        return roleMapper.selectList(null);
    }

    @Override
    public Role getRoleById(Integer id) {
        return roleMapper.selectById(id);
    }

    @Override
    public void add(Role role) {
    roleMapper.insert(role);
    }

    @Override
    public void update(Role role) {
    roleMapper.updateById(role);
    }

    @Override
    public void deleteById(Integer id) {
    roleMapper.deleteById(id);
    }
}
